<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>活动添加页面</title>
  <link rel="stylesheet" href="../../yl/index.css" />
  <!-- 布局样式 -->
  <link rel="stylesheet" href="../../yl/style.css" />
  <link rel="stylesheet" href="../../yl/mobile.css" />
  <link rel="stylesheet" href="../../yl/easyui.css" />
  <link rel="stylesheet" href="../../yl/icon.css" />
</head>

<body>
  <div class="easyui-navpanel" id="app" v-cloak>
    <header>
      <div class="m-toolbar">
        <div class="m-title">{{action=='Add'?'添加':action=='Modify'?'修改':''}}{{dataForm.Activity_Type}}活动信息</div>
      </div>
    </header>
    <div class="easyui-navpanel panel-body panel-body-nobottom panel-body-noborder" style="height: 3000px"
      id="MainTable" ref="MainTable"
      :data-options="JSON.stringify({ 'TableName': 'party_organization_activities', 'form': 'dataForm' ,'primary_key':'Party_Organization_Activity_SerialNumber'})">
      <div class="yl-main">
        <div class="table_titel">
          <div class="titel">{{dataForm.Activity_Type}}活动信息</div>
        </div>
        <el-form :model="dataForm" ref="form" :inline-message="true" style="width: 100%">
          <el-descriptions v-if="is" :column="1" size="large" border>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">活动名称</div>
              </template>
              <el-form-item prop="Activity_Name" :rules="[{ required: true, message: '请输入活动名称', trigger: 'blur' }]">
                <el-input  v-model="dataForm.Activity_Name" class="borderless-input"
                  placeholder="请输入活动名称" ></el-input>
              </el-form-item>

            </el-descriptions-item>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">所属党组织</div>
              </template>
              <!-- <el-select @change="changeOrganization" v-model="dataForm.Party_Organization_SerialNumber"
                placeholder="请选择所属党组织" size="large">
                <el-option v-for="item in Manager" :key="item.Party_Organization_SerialNumber"
                  :label="item.Party_Organization_Name" :value="item.Party_Organization_SerialNumber" />
              </el-select> -->
              <el-form-item prop="Party_Organization_SerialNumber"
                :rules="[{ required: true, message: '请选择所属党组织', trigger: 'change' }]">
                <el-cascader @change="(val)=>{this.changeOrganization([val])} " v-model="dataForm.Party_Organization_SerialNumber" filterable
                  class="borderless-input" style="width: 100%;"
                  :props="{value:'Party_Organization_SerialNumber',label:'Party_Organization_Name',children:'children',checkStrictly: true, emitPath:false}"
                  placeholder="请选择所属党组织" :options="Manager" style="width: 100%"></el-cascader>
              </el-form-item>

            </el-descriptions-item>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">活动类型</div>
              </template>

              <el-select disabled v-model="dataForm.Activity_Type" placeholder="请选择活动类型" size="large">
                <el-option v-for="item in activityType" :key="item.value" :label="item.label" :value="item.value" />
              </el-select>
            </el-descriptions-item>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">召开时间</div>
              </template>
              <el-form-item prop="Activity_Datetime"
                :rules="[{ required: true, message: '请选择召开时间', trigger: 'change' }]">
                <el-date-picker v-model="dataForm.Activity_Datetime" type="datetime" placeholder="请选择召开时间"
                  class="borderless-input" format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss"
                  size="large" ></el-date-picker>
              </el-form-item>

            </el-descriptions-item>
            <el-descriptions-item v-if="dataForm.Activity_Type!='双联系双报到'">
              <template #label>
                <div class="cell-item">召开地点</div>
              </template>
              <el-form-item prop="Activity_Location"
                :rules="[{ required: true, message: '请选择召开地点', trigger: 'blur' }]">
                <el-input  v-model="dataForm.Activity_Location"
                class="borderless-input" placeholder="请输入召开地点" ></el-input>
              </el-form-item>
              
            </el-descriptions-item>
            <el-descriptions-item v-if="dataForm.Activity_Type=='双联系双报到'">
              <template #label>
                <div class="cell-item">网格</div>
              </template>
              <yl-select @change="changeGrid" :props="{value:'Grid_SerialNumber',label:'Grid_Name'}"
                v-model="dataForm.Grid_SerialNumber" clearable filterable placeholder="请选择网格" :options="grid">
                <el-table-column prop="Grid_SerialNumber" show-overflow-tooltip label="网格编号"></el-table-column>
                <el-table-column prop="Grid_Name" show-overflow-tooltip label="网格名称"></el-table-column>
                <el-table-column prop="Province" show-overflow-tooltip label="省"></el-table-column>
                <el-table-column prop="City" show-overflow-tooltip label="市"></el-table-column>
                <el-table-column prop="County" show-overflow-tooltip label="区"></el-table-column>
                <el-table-column prop="Town" show-overflow-tooltip label="乡镇"></el-table-column>
                <el-table-column prop="Village" show-overflow-tooltip label="村庄"></el-table-column>
              </yl-select>
            </el-descriptions-item>
            <el-descriptions-item v-if="dataForm.Activity_Type=='双联系双报到'">
              <template #label>
                <div class="cell-item">报到地点(蓝牌)</div>
              </template>
              <yl-select @change="changeBluePlate" :disabled="blue_plate.length == 0"
                :props="{value:'Blue_Plate_SerialNumber',label:'Blue_Plate_Name'}" v-model="dataForm.Report_Location"
                clearable filterable placeholder="请选择报到地点" :options="blue_plate">
                <el-table-column prop="Blue_Plate_SerialNumber" show-overflow-tooltip label="蓝牌编号"></el-table-column>
                <el-table-column prop="Blue_Plate_Name" show-overflow-tooltip label="蓝牌名称"></el-table-column>
                <el-table-column prop="Plate_Type_SerialNumber" show-overflow-tooltip label="蓝牌类型"></el-table-column>
                <el-table-column prop="Personal_Name" show-overflow-tooltip label="负责人"></el-table-column>
                <el-table-column prop="Contact_Phone" show-overflow-tooltip label="联系方式"></el-table-column>
              </yl-select>
            </el-descriptions-item>
            <el-descriptions-item v-if="dataForm.Activity_Type=='民主生活会'">
              <template #label>
                <div class="cell-item">单位名称</div>
              </template>
              <el-cascader v-model="dataForm.Government_Agencies_SerialNumber" placeholder="请选择所属组织"
                :options="organization2" class="borderless-input" style="width: 100%;"
                :props="{ value:'Government_Agencies_SerialNumber', label:'Agensies_Name' ,checkStrictly: true , emitPath:false}"></el-cascader>
            </el-descriptions-item>
            <el-descriptions-item v-if="true">
              <template #label>
                <div class="cell-item">活动积分</div>
              </template>
              <el-input-number v-model="dataForm.Activity_Points" :min="1" :max="10" ></el-input-number>
            </el-descriptions-item v-if="true">
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">活动内容</div>
              </template>
              <el-form-item prop="Activity_Content" :rules="[{ required: true, message: '请输入活动内容', trigger: 'blur' }]">
                <el-input type="textarea" :rows="5"
                  v-model="dataForm.Activity_Content" class="borderless-input" placeholder="请输入活动内容" />
              </el-form-item>
            </el-descriptions-item>
            <el-descriptions-item v-if="true">
              <template #label>
                <div class="cell-item">记录人</div>
              </template>
              <el-form-item prop="Recorder_SerialNumber"
                :rules="[{ required: true, message: '请选择记录人', trigger: 'change' }]">
                <!-- <el-select filterable v-model="dataForm.Recorder_SerialNumber" placeholder="请选择记录人" size="large">
                  <el-option v-for="item in Recorder" :key="item.ID_Card_Number" :label="item.Personal_Name"
                    :value="item.ID_Card_Number" />
                </el-select> -->
                <yl-select :disabled="Recorder.length == 0" v-model="dataForm.Recorder_SerialNumber" clearable filterable placeholder="请选择记录人"
                  :options="Recorder" :props="{value:'ID_Card_Number',label:'Personal_Name'}">
                  <el-table-column prop="ID_Card_Number" width="180" show-overflow-tooltip
                    label="身份证号"></el-table-column>
                  <el-table-column prop="Picture_URL" label="头像">
                    <template v-slot="{row}">
                      <el-image style="width: 100px;height: 100px;" :src="row.Picture_URL? photo + row.Picture_URL:'../../admin/icons/NoLogo.png'"></el-image>
                    </template>
                  </el-table-column>
                  <el-table-column prop="Personal_Name" show-overflow-tooltip label="姓名"></el-table-column>
                  <el-table-column prop="Contact_Phone" label="联系方式"></el-table-column>
                </yl-select>
              </el-form-item>
            </el-descriptions-item>
            <el-descriptions-item v-if="dataForm.Activity_Type=='双联系双报到'">
              <template #label>
                <div class="cell-item">坐标</div>
              </template>
              <el-form-item prop="Coord" :rules="[{ required: true, validator:IS_Coords, trigger: 'blur' }]">
                <el-input disabled id="lcenter" v-loading="loading" type="textarea" :autosize="{ minRows: 2}"
                  v-model.trim="dataForm.Coord" class="borderless-input" placeholder="请输入坐标" />
              </el-form-item>
            </el-descriptions-item>
            <!-- <el-descriptions-item>
              <template #label>
                <div class="cell-item">会议总结</div>
              </template>
              <el-upload multiple v-model:file-list="fileList" class="upload-demo" action="" :before-upload="beforeUpload"
                :before-remove="beforeRemove">
                <el-button type="primary" disabled>点击上传会议总结</el-button>
              </el-upload>
            </el-descriptions-item> -->
            <!-- <el-descriptions-item>
              <template #label>
                <div class="cell-item">记录人</div>
              </template>
              <el-form-item prop="Recorder_SerialNumber" :rules="[{ required: true, message: '请选择记录人', trigger: 'change' }]">
                <el-select disabled v-model="dataForm.Recorder_SerialNumber" placeholder="请选择记录人" size="large">
                  <el-option v-for="item in Recorder" :key="item.ID_Card_Number" :label="item.Personal_Name"
                    :value="item.ID_Card_Number" />
                </el-select>
              </el-form-item>
            </el-descriptions-item> -->
          </el-descriptions>
        </el-form>
        <div id="ChildTable">
          <div class="table_titel">
            <div class="titel">参与人员</div>
            <div class="operation">
              查询该组织下子组织全部党员
              <el-button :type="isTree?'danger':'primary'" size="small"
                @click="isTree = !isTree">{{isTree?'取消':'查询'}}</el-button>
            </div>
          </div>
          <el-descriptions
            :data-options="JSON.stringify({ 'TableName': 'party_organization_activities_members', 'form': 'childDataForm', 'ParentTableName': 'party_organization_activities'})"
            :column="1" size="large" border>
          </el-descriptions>
          <el-table max-height="450" tooltip-effect="dark" :data="childDataForm.filter(i=>i.Row_Status != '1')">
            <el-table-column align="center" prop="Personal_Name" label="参与党员姓名">
              <template v-slot="{row}">
                {{Personal_Name(row.ID_Card_Number)}}
              </template>
            </el-table-column>
            <el-table-column align="center" label="操作" fixed="right">
              <template #default="{row,$index}">
                <el-button size="small" @click="handleRemove1(row,$index)">
                  移除
                </el-button>
              </template>
            </el-table-column>
          </el-table>
        </div>
      </div>

    </div>
    <footer class="botton-ann">
      <el-button @click="goBack">返回</el-button>
      <el-button type="primary" plain @click="handleSubmit" :loading="loading">提交</el-button>
    </footer>
  </div>
</body>
<script src="../../yl/vue.js"></script>
<script src="../../config/config.js"></script>
<script src="../../utils/utils.js"></script>
<script src="../../utils/mixins.js"></script>
<script src="../../yl/index.js"></script>
<script src="../../yl/zh-cn.mjs"></script>
<script src="../../yl/index.iife.min.js"></script>
<script src="../../yl/jquery.min.js"></script>
<script src="../../utils/jquery.cookie.js"></script>
<script src="../../yl/jquery.easyui.min.js"></script>
<script src="../../yl/jquery.easyui.mobile.js"></script>
<script src="../../yl/moment.min.js"></script>
<script src="../../api/request.js"></script>
<script src="./js/Add.js"></script>

</html>